import dotenv from 'dotenv'

dotenv.config()

export const config = {
  port: parseInt(process.env['PORT'] || '3001', 10),
  
  openai: {
    apiKey: process.env['OPENAI_API_KEY'] || '',
    endpoint: process.env['OPENAI_API_ENDPOINT'] || 'https://apic1.ohmycdn.com',
  },
  
  imageApi: {
    apiKey: process.env['IMAGE_API_KEY'] || '',
    endpoint: process.env['IMAGE_API_ENDPOINT'] || 'https://ark.cn-beijing.volces.com/api/v3/images/generations',
  },
  
  api: {
    timeout: parseInt(process.env['API_TIMEOUT'] || '30000', 10),
    retryAttempts: parseInt(process.env['API_RETRY_ATTEMPTS'] || '3', 10),
  },
}
